<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [1,2,3,4]
        // arr[i]
        // indexOf  查询数组的某个值得下标
        // slice(startIndex,endIndex) 截取 包含开始不含结束
        // slice(startIndex) 截取从startIndex开始到后面的所有值
        console.log(arr.indexOf(4)); // 3
        console.log(arr.slice(1,3)); //[2,3]
        console.log(arr.slice(1)); // [2,3,4]
    </script>
</body>
</html>